--最终旅途
local zuizhonglvcheng = fk.CreateSkill {
    name = "mcdh_zuizhonglvcheng",
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

zuizhonglvcheng:addEffect(fk.Death,{
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(self) and player ~= target
    end,
    on_cost = Util.TrueFunc,
    on_use = function(self, event, target, player, data)
        local room = player.room
        lib.LoadAmmo(player,player,lib.mcdh_getLoseammo(player),self.name)
        if target:getMark("@#mcdh_qinglixieyi_givecard") ~= 0 and not target:isNude() and room:askForSkillInvoke(player,self.name,nil,"#mcdh_zuizhonglvcheng_getcard:"..target.id) then
            local cards_id = target:getCardIds{Player.Hand, Player.Equip}
            local dummy = Fk:cloneCard'slash'
            dummy:addSubcards(cards_id)
            room:obtainCard(player.id, dummy, false, fk.ReasonPrey)
        end
    end,
})

Fk:loadTranslationTable {
    ["mcdh_zuizhonglvcheng"] = "终旅",
    [":mcdh_zuizhonglvcheng"] = "『最终旅程』<br>当一名其他角色死亡时，你装填弹药至上限；若你因〖净除〗交给过其牌，你可以获得其所有牌。",
    ["#mcdh_zuizhonglvcheng_getcard"] = "最终旅程：你可以获得%src所有的牌"
}

return zuizhonglvcheng